package com.ij.media.web;

import com.ij.media.service.SpiderService;
import com.ij.sso.utils.ReturnUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.ij.media.enums.RequestTypeEnums.GET;

@RestController
@RequestMapping("/spider")
public class SpiderController {
    @Autowired
    SpiderService spiderService;
    @RequestMapping("/test")
    public ReturnUtil testRequest(){
        String url = "http://localhost:8080/api/getConfig?key=file_prefix";
        return ReturnUtil.success( spiderService.testRequest(url,GET));
    }

    @RequestMapping("/test1")
    public ReturnUtil testGet(){
        String url = "https://movie.douban.com/j/search_tags?type=movie&source=";
        return ReturnUtil.success( spiderService.testRequest(url,GET));
    }

}
